package com.ruoyi.system.mapper;

import com.ruoyi.system.pojo.entity.Product;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Value;

import java.util.List;

public interface AgoniProductMapper {
    List<Product> listProducts();

    List<Product> findProductsByStoreId(Long storeId);

    int addProduct(Product product);

    int updateProduct(Product product);

    int getStoreIdByUserId(Long userId);

    @Select("SELECT * FROM agoni_product WHERE id = #{productId}")
    Product selectProductById(long productId);
@Select("SELECT * FROM agoni_product WHERE store_id != #{storeId} and status = 1")
    List<Product> listOtherProducts(Long storeId);

@Select("SELECT * FROM agoni_product WHERE store_id = #{storeId} ")
    List<Product> listMyStoreProductVO(Long storeId);


    List<Product> listOtherProductsByPage(@Param("storeId") Long storeId, @Param("keywords") String keywords, @Param("productType") Integer productType);

    @Select("SELECT category FROM agoni_product WHERE id = #{productId}")
    Long getCategoryById(Long productId);
}
